/* eslint-disable */
/** @type {import('next').NextConfig} */

const isProd = process.env.NEXT_PUBLIC_APP_ENV == "prod"
const isStaging = process.env.NEXT_PUBLIC_APP_ENV == "staging"
const nextConfig = {
  transpilePackages: ["chart.js", "@ant-design/charts", "@ant-design/plots", "d3-interpolate", "echarts-gl"],
  experimental: { esmExternals: "loose" },
  images: {
    unoptimized: true
  },
  async rewrites() {
    return [
      { 
        source: '/psj-cloud-app/:path*',
        destination: 'https://testadmin.parceljet.com/psj-cloud-app/:path*', // 将请求代理到外部 API
      },
    ];
  },
  output: "export",
  eslint: {
    // Warning: This allows production builds to successfully complete even if
    // your project has ESLint errors.
    ignoreDuringBuilds: true
  },
  typescript: {
    // !! WARN !!
    // Dangerously allow production builds to successfully complete even if
    // your project has type errors.
    // !! WARN !!
    ignoreBuildErrors: true
  },
  // Use the CDN in production and localhost for development.
  assetPrefix: isProd
    ? "https://static.zmetaport.com/big-screen"
    : isStaging
    ? "https://uat-static.zmetaport.com/uat-big-screen"
    : undefined
}
module.exports = nextConfig
